And of course this explains the periodic error in the LED flashing...
Ioannis
Nice catch...
When someone shows you the stupid mistakes, its that moment you are embarrased a lot
Ioannis
A value of 0 in the pins PPS registers sets it to be controlled by the LAT register. See bottom of table 17-2 in the datasheet.
HenrikOlsson Yesterday, 11:08In the ISR you have this:
if seconds<1000 then
seconds=seconds+1
else
seconds=0
Timer0=0 'Stop timer0
TMR0H=$C1 'Load Timer 0 with start value...
If id does matter, chip is 47K42.
After setting the registers for a PWM output and selecting, for example, RC5PPS=%%00001001, the PWM signal indeed does appear on the output port.
What about...
Thanks Jerson.
At the moment it looked OK to have the LCDout inside the regularly called ISR, as it updatetd the LCD often. If the freq is low enough 1-2 Hz, it updates every second the LCD...
First thing that seems unusual to me is LCDOUT inside the ISR handler. That is something I would not do.
Secondly, there is a statement if freq < 68 then freq = 136 followed by freq = freq/68. As...
On the uploaded YT video one can see that the LED is not blinking stable as it should.
Can anyone spot what is wrong with the code please?
That LED is driven from the in2 output port and while...
OK - Problem solved. I went to Pololu and got help from their tech folks and they helped me figure this out. In a nutshell, it had to do with how I was creating the CTRL and TORQUE registers and...
Atom058 - 25th May 2025, 19:08
Re: Revert a port from PWM to Digital I/O
Thank you Henrik.
Ioannis Yesterday, 19:30Its ok now,
Ioannis